package hua.mtreader.main;

import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import hua.mtreader.R;

public class WelcomeActivity extends AppCompatActivity {


    private final int ENTER_HOME = 0;
    private long delayMillis = 1000;

    private Handler mHandler = new Handler(){

        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case ENTER_HOME:
                    startActivity(new Intent(WelcomeActivity.this,HomeActivity.class));
                    finish();
                    break;
            }
        }
    };


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        Message msg = Message.obtain();
        msg.what = ENTER_HOME;
        mHandler.sendMessageDelayed(msg, delayMillis);
    }
}
